package aop05;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/5/18 14:08
 * Version:1.0-SNAPSHOT
 * Description:
 */
public class AroundAdvice {

    public Object around(ProceedingJoinPoint jp) throws Throwable{
        Object result = null;

        try {
            System.out.println("环绕通知之前置通知");
            result = jp.proceed();
            System.out.println("环绕通知之正常返回通知,返回值为:"+result);
        } catch (Throwable throwable) {
            System.out.println("环绕通知之异常通知,异常为:"+throwable);
            throw throwable;
        }
        System.out.println("环绕通知之后置通知");
        return result;
    }

}
